package com.gnerv.rabbitmq.agent.common.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author Gnerv LiGen
 * @create 2023/8/3 14:41
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ResultPage<T> extends Result<T> {

    private Integer current;
    private Integer size;
    private Integer total;

    public static<T> ResultPage<T> data(T data, Integer current, Integer size, Integer total) {
        ResultPage<T> resultPage = new ResultPage<>(current, size, total);
        resultPage.setData(data);
        return resultPage;
    }

}
